<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021-01-14
 * Time: 13:37
 */
namespace smartybuilder\libs;
use smartybuilder\libs\bind\Form;
use smartybuilder\libs\bind\Table;

include_once __DIR__.DIRECTORY_SEPARATOR.'Smarty.class.php';
class Quickbuilder
{
//    public function index(){
//        $smarty = new \Smarty();
//        $smarty ->template_dir = __DIR__.DIRECTORY_SEPARATOR."Templates";
//        $smarty ->compile_dir  = __DIR__.DIRECTORY_SEPARATOR."Templates_c";
//        $smarty ->left_delimiter   = "{{";
//        $smarty ->right_delimiter  = "}}";
//        $smarty ->assign('test','你好');
//        return $smarty->display('template.htm');
//    }
    /**实例化快速构建器
     * @param string $type
     * @return bool|Form|Table
     */
    public static function make($type='form'){
        if($type=='form'){
            return new Form();
        }elseif($type=='table'){
            return new Table();
        }else{
            return false;
        }
    }

    /**获取form实例
     * @return Form
     */
    public static function makeForm(){
        return new Form();
    }

    /**获取table实例
     * @return Table
     */
    public static function makeTable(){
        return new Table();
    }
}